/*
 * model.h
 *
 *  Created on: Jul 4, 2012
 *      Author: baris
 */

#ifndef MODEL_H_
#define MODEL_H_

#include <Judy.h>
#include "datatypes.h"

// the TBox
TBox* tbox;


//////////////////////////////////////////////////////////////////////////////

// initializes the reasoner and the necessary fields of the TBox
void init_reasoner();

// returns the atomic concept with given name or creates if it does not
// already exist
Concept* get_create_atomic_concept(char* name, TBox* tbox);

// returns the atomic role with given name or creates if it does not
// already exist
Role* get_create_atomic_role(char* name, TBox* tbox);

// get or create the existential restriction with role r and filler f
Concept* get_create_exists_restriction(Role* r, Concept* f, TBox* tbox);

// get or create the existential restriction with the given conjuncts
Concept* get_create_conjunction(int conjunct_count, Concept** conjuncts, TBox* tbox);

// create the subclass axiom with the given concept descriptions
SubClassAxiom* create_subclass_axiom(Concept* lhs, Concept* rhs);

// create the equivalent class axiom with the given concept descriptions
EqClassAxiom* create_eqclass_axiom(Concept* lhs, Concept* rhs);

// add a given subclass axiom to the TBox
void add_subclass_axiom(SubClassAxiom* ax, TBox* tbox);

// add a given equivalent classes axiom to the TBox
void add_eqclass_axiom(EqClassAxiom* ax, TBox* tbox);

// add a given subrole axiom to the TBox
void add_subrole_axiom(SubRoleAxiom* ax, TBox* tbox);
#endif /* MODEL_H_ */
